package com.baizhi.controller;

import com.baizhi.service.UserService;
import com.baizhi.serviceplus.UserServicePlus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

@Controller
@ResponseBody
public class UserController {
    @Autowired
    private UserServicePlus userServicePlus;
    @Autowired
    private UserService userService;

    @RequestMapping("selectAllUser")
    public Map selectAllUser(Integer page,Integer limit){
        Map map = userService.selectAllUser(page, limit);
        return map;

    }
    @RequestMapping("updateStatus")
    public Map updateStatus(Integer status,Integer id){
        System.out.println("--------------------------");
        System.out.println("当前状态:"+status);
        System.out.println("id::"+id);
        Map map = userServicePlus.update(status, id);
        return map;

    }
    @RequestMapping("deleteUser")
    public Map deleteUser(Integer id){
        Map map = userServicePlus.deleteUser(id);
        return map;

    }

}
